﻿using System;
using System.Collections.Generic;
using Autodesk.Revit.DB;
using Autodesk.Revit.DB.ExtensibleStorage;

namespace YJKIndicateDimension.DrawLaneLine
{
	public class SchemaData
	{
		public SchemaData(Guid schemaId, string strSchemaName, string strDocumentation = "")
		{
			this.m_strSchemaId = schemaId.ToString();
			this.m_strSchemaName = strSchemaName;
			this.m_ReadAccess = (AccessLevel)1;
            this.m_WriteAccess = (AccessLevel)1;
			this.m_strDocumentation = strDocumentation;
		}

		public void AddFieldData(string strFieldName, Type fieldType, UnitType unitType)
		{
			this.m_lstFieldData.Add(new FieldData(strFieldName, fieldType.FullName, unitType));
		}

		public void AddFieldData(FieldData fieldData)
		{
			this.m_lstFieldData.Add(fieldData);
		}

		public void AddFieldData(List<FieldData> lstFieldData)
		{
			if (lstFieldData.Count > 0)
			{
				this.m_lstFieldData.AddRange(lstFieldData);
			}
		}

		public List<FieldData> FiledData
		{
			get
			{
				return this.m_lstFieldData;
			}
			set
			{
				this.m_lstFieldData = value;
			}
		}

		public string SchemaId
		{
			get
			{
				return this.m_strSchemaId;
			}
			set
			{
				this.m_strSchemaId = value;
			}
		}

		public AccessLevel ReadAccess
		{
			get
			{
				return this.m_ReadAccess;
			}
			set
			{
				this.m_ReadAccess = value;
			}
		}

		public AccessLevel WriteAccess
		{
			get
			{
				return this.m_WriteAccess;
			}
			set
			{
				this.m_WriteAccess = value;
			}
		}

		public string Documentation
		{
			get
			{
				return this.m_strDocumentation;
			}
			set
			{
				this.m_strDocumentation = value;
			}
		}

		public string SchemaName
		{
			get
			{
				return this.m_strSchemaName;
			}
			set
			{
				this.m_strSchemaName = value;
			}
		}

		private AccessLevel m_ReadAccess;

		private AccessLevel m_WriteAccess;

		private List<FieldData> m_lstFieldData = new List<FieldData>();

		private string m_StrApplicationId;

		private string m_strSchemaId;

		private string m_strVendorId;

		private string m_strSchemaName;

		private string m_strDocumentation;
	}
}
